package com.xujianlun.cpms.exception;

import com.xujianlun.cpms.common.BaseCodeEnum;
import lombok.Data;

@Data
public class ServiceException extends RuntimeException {

    private int code;
	private String msg;

    public ServiceException(String msg){
        super(msg);
        this.msg=msg;
    }

    public ServiceException(int code,String msg){
        super(msg);
        this.code=code;
        this.msg=msg;
    }

    public ServiceException(BaseCodeEnum baseCodeEnum){
        this(baseCodeEnum.getCode(),baseCodeEnum.getMessage());
    }
}
